﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Web.Http;

using API.Models;
using API.Models.Repository;

namespace API.Controllers.api
{
    public class COMPANIES_MAPPINGController : BasicController
    {
        public COMPANY_MAP Get(Guid SUPPLIER_GUID)
        {
            var repository = new COMPANIES_MAPPING_Repository();
            repository.SetSession(this.currentSession);

            return repository.GetMapping(SUPPLIER_GUID);
        }

        public void Post(COMPANY_MAP map)
        {
            var repository = new COMPANIES_MAPPING_Repository();
            repository.SetSession(this.currentSession);

            repository.SetMapping(
                map.LEFT_COMPANY_MAP.GUID_RECORD, 
                map.RIGHT_COMPANY_MAP.GUID_RECORD);
        }
    }
}
